package com.newway.wechat.context;

public class UserInfoContext {

    private static ThreadLocal<UserInfo> threadLocal = new InheritableThreadLocal<>();

    private UserInfoContext(){

    }

    public static UserInfo getUserInfo(){
        UserInfo userInfo = threadLocal.get();
        return userInfo;
    }

    public static void putUserInfo(UserInfo userInfo){
        threadLocal.set(userInfo);
    }

    public static void removeUserInfo(){
        threadLocal.remove();
    }
}
